var myvue = new Vue({
	el: "body",
	data: {
		loading: false,
		ifdl: false,
		noneorder: false,
		hasorder: false,
		orderdata: "",
		img: "../index/"
	},
	created: function() {
		this.leancloudinit();
	},
	methods: {
		leancloudinit: function() {
			var _this = this;
			var APP_ID = 'c4w6bVvWfh8xxcmkBE1G0gIt-gzGzoHsz';
			var APP_KEY = 'JBikg4Ksk76zcTi5BKYWvTJF';
			AV.init({
				appId: APP_ID,
				appKey: APP_KEY
			});
			if(AV.User.current() == null) {
				this.ifdl = true;
				this.noneorder = false;
				this.hasorder = false;
			} else {
				this.ifdl = false;
				var phonenum = AV.User.current().attributes.username;
				var query = new AV.Query('ELM_order');
				query.contains('user_phonenum', phonenum);
				query.find().then(function(data) {
					if(data.length > 0) {
						_this.hasorder = true;
						_this.orderdata = data;
						_this.noneorder = false;
					} else {
						_this.noneorder = true;
					}

				}, function(error) {
					// 异常处理
				}).then(function(){
					_this.loading = true;
				});
			}
		},
		tzorder: function(id) {
			location.href = "../rightorder/rightorder.html?zt=2&id=" + seturl(id);
		},
		tzlogin:function(){
			location.href = "../login/login.html";
		}
	}
})